/*
 * By: Werner Schuster (murphee)
 * 
 * Copyright (c) 2005-2006 Werner Schuster (murphee)
 * 
 * This file is part of the EclipseShell project. EclipseShell is subject 
 * to the Eclipse Public License (EPL) available at
 * http://www.eclipse.org/org/documents/epl-v10.php
 * or in the file /epl-v10.html in the source for other info
 * see the /eclipseshell.license file
 */
package net.sf.eclipseshell.editors;

import org.eclipse.jface.text.*;
import org.eclipse.jface.text.rules.*;

public class DefaultScanner extends RuleBasedScanner {

	public DefaultScanner(ColorManager manager) {
		IToken string =
			new Token(
				new TextAttribute(manager.getColor(DefaultColorConstants.STRING)));

		IRule[] rules = new IRule[2];

		// Add rule for double quotes
		rules[0] = new SingleLineRule("\"", "\"", string, '\\');
		// Add a rule for single quotes
		rules[1] = new SingleLineRule("'", "'", string, '\\');
		// Add generic whitespace rule.
//		rules[2] = new WhitespaceRule(new XMLWhitespaceDetector());

		setRules(rules);
	}
}
